package com.myproject.myapp.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.myproject.myapp.dao.MariaDao;
import com.myproject.myapp.vo.MariaVo;

@Repository
public class MariaDaoImpl implements MariaDao{

	
	private final String add = "INSERT INTO home(phone, address, name) VALUES (?, ?, ?)";
	
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	@Override
	public void add(MariaVo mariaVo) {
		System.out.println(mariaVo.toString());
		System.out.println(mariaVo.getPhone());
		System.out.println(mariaVo.getAddress());
		System.out.println(mariaVo.getName());
		jdbcTemplate.update(add, 
				new Object[] {mariaVo.getPhone(), mariaVo.getAddress(), mariaVo.getName()});
	}

	@Override
	public MariaVo getView(int num) {
		
		return null;
	}

	@Override
	public void edit(int num) {
		
	}

	@Override
	public void del(int num) {
		
	}

	
	
}
